import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
// 按需引入element-plus
import Components from 'unplugin-vue-components/vite'
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
import AutoImport from 'unplugin-auto-import/vite'
// https://vite.dev/config/
export default defineConfig({
// 设置scss的api类型为modern-compiler
  css: {
    preprocessorOptions: {
      scss: {
        api: 'modern-compiler'
      }
    }
  },

  plugins: [
    vue(),
    // 按需引入element-plus 插件
    Components({
      resolvers: [ElementPlusResolver()],
    }),
    // 自动引入element-plus插件
    AutoImport({
      resolvers: [ElementPlusResolver()],
    }),

  ],
})
